
// 获取token信息
function token() {
	// 初始化返回值
	var data_return = false;
	// 读取临时缓存
	// var save_short = uni.$focus.varForever();
	var save_short = uni.$focus.varForever('get');
	if (save_short && save_short.token) { data_return = save_short.token; }
	// 返回数据
	return data_return;
}

export default {
	//首页证书
	getCertificateType:function(objC){
		uni.$focus.request({
			method: "get",
			data:{
				...objC.data,
				user_id:uni.getStorageSync("eduInfo").userId,
			},
			openToast: false, 
			url: `/aq_course/app/v2/cert/certTypeCount`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//绑定身份同步学时
	bindingSentry:function(objC){
		uni.$focus.request({
			method: "get",
			data:objC.data,
			openToast: false, 
			openGreen: true, 
			url: `/aq_user/v2/sentry/postUserSentryPid`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//入场学习学习权限
	enterStudyRecord:function(objC){
		uni.$focus.request({
			method: "get",
			data:objC.data,
			openToast: false, 
			openGreen: true, 
			url: `/aq_course/app/v2/cert/scoreLogWxEntranceStudy`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//首次入场权限
	getLastStudy:function(objC){
		uni.$focus.request({
			method: "get",
			data:objC.data,
			openToast: false, 
			openGreen: true, 
			url: `/aq_course/app/v2/cert/readingPosition`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//入场学习学分
	getEnterScore:function(objC){
		uni.$focus.request({
			method: "get",
			data:objC.data,
			openToast: false, 
			openGreen: true,   
			url: `/aq_course/app/v2/cert/admissionStudy`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//证书
	getCertificatePage:function(objC){
		uni.$focus.request({
			method: "get",
			data:{
				...objC.data,
				user_id:uni.getStorageSync("eduInfo").userId,
				id_card:uni.getStorageSync("eduInfo").id_card2
			},
			openToast: false, 
			url: `/aq_course/app/v2/cert/certListIndex`,
			header: {
				"token": token()||""
			},
			success: (res) => {
				// 回调数据
				if (objC.success) { objC.success(res); }
			},
			fail:(err)=>{
				if (objC.fail) { objC.fail(err); }
			}
		});
	},
	//入场学习
	scoreForStudy: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_course/app/v2/cert/admissionStudy',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token() || ''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//公告详情
	getMessageDetail: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_course/app/v2/notices/details',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token() || ''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//公告列表
	getMessageList: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_course/app/v2/notices/noticeList',
			data: objC.data,
			header: {
				"token": token() || ''
			},
			openToast: false, 
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//证书列表
	getNewworkPhotoList: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_course/app/v2/cert/getSourceList',
			data: {
				...objC.data,
				user_id:uni.getStorageSync("eduInfo").userId,
				id_card:uni.getStorageSync("eduInfo").id_card2
			},
			openGreen:true,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//测评记录
	getTestRecordList: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paper/getSentryPidPaperList',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	
	
	//新考人员问答详情
	getQuestionAndAnswerDetail: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_attach/v2/problem/problemList',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//新考人员问答
	getQuestionAndAnswer: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_attach/v2/problem/problemCategoryList',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//新考人员测评规则
	getNewTestRoles: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paper/getSentryPidPaperCount',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//排名数据获取2
	getUserPaperRewardSentry: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getUserPaperRewardSentry',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//排名数据获取1
	getUserPaperReward: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getUserPaperReward',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//获取个人最好成绩
	getPersonBest: function(objC) {
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getUserMaxScore',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//获取考试时间
	getTimeLast: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paper/getWorkPaperTime',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//单位排名
	getConpanyList: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getUserPaperWorkRanking',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	
	//人物排名
	getLeaderList: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getUserPaperRanking',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//是否打开试卷
	isOpen: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getTimeValue',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//获取单位列表
	getCompanyList: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "post",
			url: '/aq_user/v2/paperRanking/getUserPaperWorkList',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}	
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//信息确认页
	infoConfirm: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "post",
			url: '/aq_user/v2/paperRanking/postWorkInfoChange',
			data: objC.data,
			openToast: true, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//信息确认页是否跳转
	getWorkInfoChange: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paperRanking/getWorkInfoChange',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
		//交卷
	handPaper: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "post",
			url: '/aq_user/v2/paper/workSubmitPaper',
			loadingText: "交卷中",
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});		
	},
	//答题
	answerQuestion: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "post",
			url: '/aq_user/v2/paper/workAnswer',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
			
			
	},

	//获取试卷
	getQuestionList: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/paper/getPaperQuestionList',
			data: objC.data,
			openToast: false,  
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
					
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
			
			
	},
	//组卷
	createWorkPaper: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "post",
			url: '/aq_user/v2/paper/createWorkPaper',
			data: objC.data,
			openToast: false, 
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
					
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
	},
	//获取首页banner
	getBannerList: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_attach/v2/adpopup/getBannerList',
			data: objC.data,
			header: {
				"token": token()||''
			},
			openToast: false, 
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
					
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
			
			
	},
	//获取客服电话
	getPhone: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/common/getCustomerDetail',
			urlData: objC.data,
			openToast: false, 
			header: {
				"token": token()||""
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
					
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
			
			
	},
	getCustomerService: function(objC) {
		// 接口请求
		uni.$focus.request({
			method: "get",
			url: '/aq_user/v2/common/createUlQqToken',
			data: objC.data,
			header: {
				"token": token()||''
			},
			fail: (err) => {
				if(objC.fail){
					objC.fail(err)
				}
					
			},
			success: (res) => {
				if(objC.success){
					objC.success(res);
				}					
			}
		});	
			
			
	},
	
	
	
	
}